Inference of termination conditions
نویسنده
چکیده
Numerical computations form an essential part of almost any real-world program. Clearly, in order for a termination analyser to be of practical use it should contain a mechanism for inferring termination of such computations. However, this topic attracted less attention of the research community. In works of Der-showitz et al. 5] and Ruggieri 9] such termination analysis techniques were presented. In 8] a termination inference technique for constraints logic programming was suggested. The study of termination for constraint logic programs 9] provide the necessary theoretical results and imply the equivalence of a variant of acceptability 1] and termination. Unfortunately, this work does not provide a methodology for actual proving termination or inferring conditions that imply it. Alternatively, Mesnard 8] provides techniques for inferring termination conditions, but does not consider inherently non well-founded CLP-domains. In this paper we present a termination inference technique for numerical loops based on the well-known constraints based approach 4], further extending 3], and on the adornments technique 6, 7]. We restrict our interest only to integer loops, since termination of real number computations is often implementation dependent (see 5]). Example 1. This example illustrates two possible sources of termination. First, if no rule is applicable for some query (e.g. ??p(?1)), and second, if some rules are applicable, but the execution terminates(e.g. ?? p(3) or ?? p(7)). We distinguish between these cases and infer termination conditions separately. A condition ensuring termination in the rst case is deened syntactically, based on the constraints appearing in rules bodies. One of the major diiculties while analysing termination in the second case is deening correct level-mappings. On the one hand, level-mappings should map atoms to natural numbers. On the other hand, level-mappings should reeect the possibly negative numeric values of integer arguments. This contradiction is solved by step-by-step inference of bounded integer arguments and reening the deenition of the level-mapping.
منابع مشابه
Inferring Termination Conditions for Logic Programs Using Backwards Analysis
This paper focuses on the inference of modes for which a logic program is guaranteed to terminate. This generalises traditional termination analysis where an analyser tries to verify termination for a specified mode. Our contribution is a methodology in which components of traditional termination analysis are combined with backwards analysis to obtain an analyser for termination inference. We i...
متن کاملApplying Static Analysis Techniques for Inferring Termination Conditions of Logic Programs
We present the implementation of cTI, a system for universal left-termination inference of logic programs, which heavily relies on static analysis techniques. Termination inference generalizes termination analysis/checking. Traditionally, a termination analyzer tries to prove that a given class of queries terminates. This class must be provided to the system, requiring user annotations. With te...
متن کاملDetecting Optimal Termination Conditions of Logic Programs
In this paper, we begin with an approach to non-termination inference of logic programs. Our framework relies on an extension of the Lifting Theorem, where some specific argument positions can be instantiated while others are generalized. Atomic left looping queries are generated bottom-up from selected subsets of the binary unfoldings of the program of interest. Then non-termination inference ...
متن کاملInference of Well-Typings for Logic Programs with Application to Termination Analysis
This paper develops a method to infer a polymorphic well-typing for a logic program. One of the main motivations is to contribute to a better automation of termination analysis in logic programs, by deriving types from which norms can automatically be constructed. Previous work on type-based termination analysis used either types declared by the user, or automatically generated monomorphic type...
متن کامل